Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add playfair cipher #2813

Closed
wants to merge 10 commits into from

Conversation

JaydityaDhaka
Copy link

Description of Change

This pull request adds the implementation of the Playfair Cipher algorithm. The Playfair cipher is a digraph substitution cipher, which encrypts pairs of letters from the plaintext using a 5x5 grid. It provides both encryption and decryption functions, handling edge cases such as repeated letters and handling of the 'j' character by replacing it with 'i'.

Key Features:

  • Implementation of the encryption and decryption methods.
  • A utility to clean input strings by removing non-alphabet characters and converting the text to lowercase.
  • Generation of the Playfair 5x5 grid based on a provided key.
  • Supports formatted digraphs and insertion of 'x' for repeated characters and padding.

Checklist

[x] Added description of change
[x] Added file name matches File name guidelines
[x] Added tests and example, test must pass
[x] Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
[x] Relevant documentation/comments is changed or added
[x] PR title follows semantic commit guidelines
[x] Search previous suggestions before making a new one, as yours may be a duplicate.
[x] I acknowledge that all my contributions will be made under the project's license.

Notes:
This pull request includes a detailed file header using Doxygen-style comments, an example of usage with both encryption and decryption of sample text, and test cases to ensure the correctness of the algorithm.

@JaydityaDhaka JaydityaDhaka changed the title Feature :Added playfair cipher Feat: Add playfair cipher Oct 11, 2024
@JaydityaDhaka
Copy link
Author

are there any additional requirments for this PR?

ciphers/playfair_cipher.cpp Outdated Show resolved Hide resolved
ciphers/playfair_cipher.cpp Outdated Show resolved Hide resolved
@JaydityaDhaka
Copy link
Author

JaydityaDhaka commented Oct 18, 2024

Have put in all the necessary changes, could you also add Hacktoberfest tag

* @brief Implementation of [Playfair cipher](https://en.wikipedia.org/wiki/Playfair_cipher) algorithm.
*
* @details
* The Playfair cipher is a digraph substitution cipher, meaning that it encrypts pairs of letters (digraphs)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lint your file using clang tidy please, Thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file does not seem linted!

ciphers/playfair_cipher.cpp Outdated Show resolved Hide resolved
ciphers/playfair_cipher.cpp Outdated Show resolved Hide resolved
ciphers/playfair_cipher.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@realstealthninja realstealthninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file is still not linted

Copy link
Contributor

This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Author has not responded to the comments for over 2 weeks label Dec 18, 2024
Copy link
Contributor

Please ping one of the maintainers once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!

@github-actions github-actions bot closed this Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest stale Author has not responded to the comments for over 2 weeks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants